package com.foreveross.bsl.common.utils.balance.zookeeper;


import java.util.List;

import com.foreveross.bsl.common.utils.balance.cxf.AbstractLoadBalanceStrategy;

/**
 * watcher service from zookeeper.
 *
 * @author Felix Zhang   Date:2010-10-16 01:13
 */
public class ServiceEndpointsWatcher extends ZooKeeperChildrenWatcher {

    private AbstractLoadBalanceStrategy strategy;

    public void setStrategy(AbstractLoadBalanceStrategy strategy) {
        this.strategy = strategy;
    }

    @Override
    protected void updateData(List<String> members) {
        this.strategy.setAlternateAddresses(members);
    }
}
